package com.gitee.wsl.service.task


import com.gitee.wsl.service.task.scope.JobTaskScope
import kotlinx.coroutines.Job

class JobTask(val job: Job) : SampleTask<JobTaskScope>(), JobTaskScope {

    override fun isActive():Boolean {
        return job.isActive
    }

    override fun pause() {
        TODO("Not yet implemented")
    }

    override fun cancel() {
        TODO("Not yet implemented")
    }

    override fun stop() {
        job.cancel()
    }

    override fun equals(other: Any?): Boolean {
        other?.let{
            if(other is JobTask)
                return other.job == job
        }
        return super.equals(other)
    }

    override fun hashCode(): Int {
        return job.hashCode()
    }

    override fun start() {
        TODO("Not yet implemented")
    }

}